#define  _CRT_SECURE_NO_WARNINGS 1

#include "BinaryTree.h"

int main()
{
	BTNode* trA = (BTNode*)malloc(sizeof(BTNode));
	if (trA == NULL)
	{
		return;
	}
	BTNode* trB = (BTNode*)malloc(sizeof(BTNode));
	if (trB == NULL)
	{
		return;
	}
	BTNode* trC = (BTNode*)malloc(sizeof(BTNode));
	if (trC == NULL)
	{
		return;
	}
	BTNode* trD = (BTNode*)malloc(sizeof(BTNode));
	if (trD == NULL)
	{
		return;
	}
	BTNode* trE = (BTNode*)malloc(sizeof(BTNode));
	if (trE == NULL)
	{
		return;
	}

	trA->x = 'A';
	trB->x = 'B';
	trC->x = 'C';
	trD->x = 'D';
	trE->x = 'E';

	trA->left = trB;
	trA->right = trC;

	trB->left = trD;
	trB->right = trE;

	trD->left = NULL;
	trD->right = NULL;
	trE->left = NULL;
	trE->right = NULL;
	trC->left = NULL;
	trC->right = NULL;

	PrevOrder(trA);

	int Asize = 0;
	TreeSize(trA, &Asize);

	printf("\n%d\n",Asize);

	int Bsize = 0;
	TreeSize(trB, &Bsize);

	printf("%d\n",Bsize);

	printf("%d\n", TTreeSize(trA));
	printf("%d\n",TreeLeafSize(trE));

	LevelOrder(trA);


	return 0;
}